/*
package edu.hut.bookshop.respository;

import edu.hut.bookshop.pojo.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface BookRepository extends JpaRepository<Book,Integer> {

    //删除id
    @Transactional
    @Modifying
    @Query(value = "delete from tb_jiaju tb where tb.bookId =?1",nativeQuery = true)
    int deleteByBookId(Integer bookId);

    //查找
    @Query(value = "select * from tb_jiaju tb where  tb.categoryCode =?1 ",nativeQuery = true)
    List<Book> selectAllByCategoryCode(String categoryCode);


}
*/
